template(name="dateBadge")
  if canModifyCard
    a.js-edit-date.card-date(title="{{showTitle}} {{_ 'predicate-week'}} {{#if showWeekOfYear}}{{showWeek}}{{/if}}" class="{{classes}}")
      time(datetime="{{showISODate}}")
        | {{showDate}}
        if showWeekOfYear
          b
            | {{showWeek}}
  else
    a.card-date(title="{{showTitle}} {{_ 'predicate-week'}} {{#if showWeekOfYear}}{{showWeek}}{{/if}}" class="{{classes}}")
      time(datetime="{{showISODate}}")
        | {{showDate}}
        if showWeekOfYear
          b
            | {{showWeek}}

template(name="dateCustomField")
  a(title="{{showTitle}} {{_ 'predicate-week'}} {{#if showWeekOfYear}}{{showWeek}}{{/if}}" class="{{classes}}")
    time(datetime="{{showISODate}}")
      | {{showDate}}
      if showWeekOfYear
        b
          | {{showWeek}}

template(name="minicardReceivedDate")
  if canModifyCard
    a.js-edit-date.card-date.received-date(title="{{_ 'card-received'}} {{_ 'predicate-week'}} {{#if showWeekOfYear}}{{showWeek}}{{/if}}" class="{{classes}}")
      time(datetime="{{showISODate}}")
        | {{showDate}}
        if showWeekOfYear
          b
            | {{showWeek}}
  else
    a.card-date.received-date(title="{{_ 'card-received'}} {{_ 'predicate-week'}} {{#if showWeekOfYear}}{{showWeek}}{{/if}}" class="{{classes}}")
      time(datetime="{{showISODate}}")
        | {{showDate}}
        if showWeekOfYear
          b
            | {{showWeek}}

template(name="minicardStartDate")
  if canModifyCard
    a.js-edit-date.card-date.start-date(title="{{_ 'card-start'}} {{_ 'predicate-week'}} {{#if showWeekOfYear}}{{showWeek}}{{/if}}" class="{{classes}}")
      time(datetime="{{showISODate}}")
        | {{showDate}}
        if showWeekOfYear
          b
            | {{showWeek}}
  else
    a.card-date.start-date(title="{{_ 'card-start'}} {{_ 'predicate-week'}} {{#if showWeekOfYear}}{{showWeek}}{{/if}}" class="{{classes}}")
      time(datetime="{{showISODate}}")
        | {{showDate}}
        if showWeekOfYear
          b
            | {{showWeek}}

template(name="minicardDueDate")
  if canModifyCard
    a.js-edit-date.card-date.due-date(title="{{_ 'card-due'}} {{_ 'predicate-week'}} {{#if showWeekOfYear}}{{showWeek}}{{/if}}" class="{{classes}}")
      time(datetime="{{showISODate}}")
        | {{showDate}}
        if showWeekOfYear
          b
            | {{showWeek}}
  else
    a.card-date.due-date(title="{{_ 'card-due'}} {{_ 'predicate-week'}} {{#if showWeekOfYear}}{{showWeek}}{{/if}}" class="{{classes}}")
      time(datetime="{{showISODate}}")
        | {{showDate}}
        if showWeekOfYear
          b
            | {{showWeek}}

template(name="minicardEndDate")
  if canModifyCard
    a.js-edit-date.card-date.end-date(title="{{_ 'card-end'}} {{_ 'predicate-week'}} {{#if showWeekOfYear}}{{showWeek}}{{/if}}" class="{{classes}}")
      time(datetime="{{showISODate}}")
        | {{showDate}}
        if showWeekOfYear
          b
            | {{showWeek}}
  else
    a.card-date.end-date(title="{{_ 'card-end'}} {{_ 'predicate-week'}} {{#if showWeekOfYear}}{{showWeek}}{{/if}}" class="{{classes}}")
      time(datetime="{{showISODate}}")
        | {{showDate}}
        if showWeekOfYear
          b
            | {{showWeek}}

template(name="minicardCustomFieldDate")
  a(title="{{_ 'date'}} {{_ 'predicate-week'}} {{#if showWeekOfYear}}{{showWeek}}{{/if}}" class="{{classes}}")
    time(datetime="{{showISODate}}")
      | {{showDate}}
      if showWeekOfYear
        b
          | {{showWeek}}

template(name="editCardReceivedDatePopup")
  form.edit-card-received-date
    .datepicker
      // Date input field (existing)
      // Insert calendar selector right after date input
      .calendar-selector
        label(for="calendar-received") 🗓️
        input#calendar-received.js-calendar-date(type="date")
      // Time input field (if present)
    .clear-date
      a.js-clear-date {{_ 'clear'}}
    .datepicker-actions
      button.primary.wide.left(type="submit") {{_ 'save'}}
      button.js-delete-date.negate.wide.right {{_ 'delete'}}

template(name="editCardStartDatePopup")
  form.edit-card-start-date
    .datepicker
      // Date input field (existing)
      .calendar-selector
        label(for="calendar-start") 🗓️
        input#calendar-start.js-calendar-date(type="date")
      // Time input field (if present)
    .clear-date
      a.js-clear-date {{_ 'clear'}}
    .datepicker-actions
      button.primary.wide.left(type="submit") {{_ 'save'}}
      button.js-delete-date.negate.wide.right {{_ 'delete'}}

template(name="editCardDueDatePopup")
  form.edit-card-due-date
    .datepicker
      // Date input field (existing)
      .calendar-selector
        label(for="calendar-due") 🗓️
        input#calendar-due.js-calendar-date(type="date")
      // Time input field (if present)
    .clear-date
      a.js-clear-date {{_ 'clear'}}
    .datepicker-actions
      button.primary.wide.left(type="submit") {{_ 'save'}}
      button.js-delete-date.negate.wide.right {{_ 'delete'}}

template(name="editCardEndDatePopup")
  form.edit-card-end-date
    .datepicker
      // Date input field (existing)
      .calendar-selector
        label(for="calendar-end") 🗓️
        input#calendar-end.js-calendar-date(type="date")
      // Time input field (if present)
    .clear-date
      a.js-clear-date {{_ 'clear'}}
    .datepicker-actions
      button.primary.wide.left(type="submit") {{_ 'save'}}
      button.js-delete-date.negate.wide.right {{_ 'delete'}}
